home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c++,comp.lang.c,comp.os.ms-windows.programmer.misc
- Subject: Re: fastest code
- Date: Thu, 18 Apr 96 16:54:59 GMT
- Organization: none
- Message-ID: <829846499snz@genesis.demon.co.uk>
- References: <316112A2.7D37@public.sta.net.cn> <4kjpn0INN817@keats.ugrad.cs.ubc.ca> <829352535snz@genesis.demon.co.uk> <4kof6e$te@news1.mnsinc.com> <4krbhlINNbk4@keats.ugrad.cs.ubc.ca> <3171E8D2.41C67EA6@scn.de> <4l2455$22f@nnrp1.news.primenet.com>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4l2455$22f@nnrp1.news.primenet.com>
- rogersr@primenet.com "Randy Rogers" writes:
-
- >Why not just look at the machine code with the debugger?
- >there is also an issue of whether signed arithemetic is being performed
- >if not you could just shift left 1, add, or multiply with the same result
- >how large are the vars...doubles would require additional register usage
-
- 2*i means exactly the same thing as i+i whether i is signed or
- unsigned, so the compiler can always compiler them to the same code. It
- could compile either using shifts or adds.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-